﻿Imports System
Imports System.Collections.Generic

Namespace System.Workflow.Activities.Rules
    <Serializable> _
    Public Class RuleHaltAction
        Inherits RuleAction
        ' Methods
        Public Overrides Function Clone() As RuleAction
            Return DirectCast(MyBase.MemberwiseClone, RuleAction)
        End Function

        Public Overrides Function Equals(ByVal obj As Object) As Boolean
            Return TypeOf obj Is RuleHaltAction
        End Function

        Public Overrides Sub Execute(ByVal context As RuleExecution)
            If (context Is Nothing) Then
                Throw New ArgumentNullException("context")
            End If
            context.Halted = True
        End Sub

        Public Overrides Function GetHashCode() As Integer
            Return MyBase.GetHashCode
        End Function

        Public Overrides Function GetSideEffects(ByVal validation As RuleValidation) As ICollection([Of] String)
            Return Nothing
        End Function

        Public Overrides Function ToString() As String
            Return "Halt"
        End Function

        Public Overrides Function Validate(ByVal validator As RuleValidation) As Boolean
            Return True
        End Function

    End Class
End Namespace

